﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ZeroTouchUI
{
    /// <summary>
    /// Interaction logic for RemoveGestures.xaml
    /// </summary>
    public partial class RemoveGestures : Window
    {
        MainWindow mainWindow;
        public bool delete = false;

        public RemoveGestures(MainWindow mw)
        {
            InitializeComponent();
            mainWindow = mw;
            foreach (Gesture g in mainWindow.profile.getDictionary().Keys)
                gestureList.Items.Add(g.Name);
        }

        private void Remove_Click(object sender, RoutedEventArgs e)
        {
           /* ConfirmRemove cr = new ConfirmRemove(this);
            cr.ShowDialog();
            if (delete && gestureList.SelectedItem != null)
            {
                Gesture remove = new Gesture();
                foreach (Gesture g in mainWindow.profile.getDictionary().Keys)
                    if (g.Name == gestureList.SelectedItem.ToString())
                        remove = g;
                mainWindow.profile.getDictionary().Remove(remove);
                Update();
            }
            delete = false;*/
        }

        private void RemoveAll_Click(object sender, RoutedEventArgs e)
        {
            ConfirmRemoveAll cra = new ConfirmRemoveAll(this);
            cra.ShowDialog();
            if (delete)
            {
                mainWindow.profile.Clear();
                Update();
            }
            delete = false;
        }

        private void close_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Update()
        {
            gestureList.Items.Clear();
            foreach (Gesture g in mainWindow.profile.getDictionary().Keys)
                gestureList.Items.Add(g.Name);
        }
   
    }
}
